//
//  WKAttentionTipCell.m
//  WuKongUsernameLogin
//
//  Created by tt on 2023/9/10.
//

#import "WKAttentionTipCell.h"

@implementation WKAttentionTipModel

- (Class)cell {
    return WKAttentionTipCell.class;
}

@end

@interface WKAttentionTipCell ()

@property(nonatomic,strong) UILabel *contentLbl;

@end

@implementation WKAttentionTipCell

+ (CGSize)sizeForModel:(WKAttentionTipModel *)model {
    
    return CGSizeMake(WKScreenWidth, 140.0f);
}

- (void)setupUI {
    [super setupUI];
    [self.contentView addSubview:self.contentLbl];
    
}

- (void)refresh:(WKAttentionTipModel *)model {
    [super refresh: model];
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.contentLbl.lim_left = 20.0f;
}

- (UILabel *)contentLbl {
    if(!_contentLbl) {
        
        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:@"切记：\n ❶ 请勿将组记词透露给他人 \n ❷ 助记词一旦丢失账号将无法找回 \n ❸ 请勿通过截屏，网络传输进行备份保存"];
        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
        paragraphStyle.lineSpacing = 10.0f;
        [attr addAttributes:@{NSParagraphStyleAttributeName:paragraphStyle} range:NSMakeRange(0, attr.length)];
        
        _contentLbl = [[UILabel alloc] init];
        _contentLbl.attributedText = attr;
        _contentLbl.lineBreakMode = NSLineBreakByWordWrapping;
        _contentLbl.numberOfLines = 0;
        _contentLbl.textColor = WKApp.shared.config.themeColor;
        _contentLbl.font = [WKApp.shared.config appFontOfSize:15.0f];
        [_contentLbl sizeToFit];
    }
    return _contentLbl;
}



@end
